package com.heima.user.controller.v1;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.user.service.UserActiveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/v1")
@Api(value = "用户激活(发送邮件)controller",tags = "用户激活(发送邮件)controller")
public class UserActiveController {
    @Autowired
    UserActiveService userActiveService;

    /**
     * 用户激活  解锁   修改status状态 0正常  1锁定
     * @param id  前端传过来ApUser的id
     * @return
     */
    @ApiOperation("用户激活")
    @GetMapping("/active")
    public ResponseResult active(@RequestParam("id") Integer id){

        return userActiveService.active(id);
    }

    @ApiOperation("发送激活邮件")
    @GetMapping("/send/{id}")
    public ResponseResult sendMsg(@PathVariable("id") Integer id){

        return userActiveService.sendMsg(id);
    }

}
